<script>
export default {
    name: "Home"
}
</script>

<template>
    <div>
        <h3>params</h3>
        <!--  params需要与name结合使用。刷新数据丢失.可以传递对象
              如果配置了路由 path:"/goodsList/:a/:b/:c",那么a,b,c刷新不会丢失
              -->
        <router-link :to="{
            name:'goods',
            params:{
                a:100,
                b:200,
                c:300,
                info:{
                    name:'zhangsan',
                    age:100
                }
            }
        }">商品列表1</router-link>
        <hr/>
        <router-link to="/goodsList/100/200/300">商品列表2</router-link>
        <hr/>
        <router-link :to="{
            path:'/goodsList/100/200/300'
        }">商品列表3</router-link>
        <hr/>
        <!--   path无法与params结合使用     -->
        <router-link :to="{
            path:'/goodsList',
            params:{
                a:100,
                b:200,
                c:300
            }
        }">商品列表4</router-link>
        <hr/>
        <router-link to="/goodsList/100-200-300">商品列表5</router-link>
        <hr/>
        <router-link to="/goodsList/100-200-300.html">商品列表6</router-link>

    </div>
</template>

<style scoped>

</style>